package com.secondshop.mappers;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.secondshop.models.Address;



public interface AddressMapper {
    int deleteByPrimaryKey(Long addressId);

    @Insert("    insert into os_address (address_id, user_id, user_name, user_tag, user_phone, user_adress, user_zipcode, create_time, update_time) values (#{addressId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR},     #{userTag,jdbcType=VARCHAR}, #{userPhone,jdbcType=VARCHAR}, #{userAdress,jdbcType=VARCHAR},      #{userZipcode,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}  )")
    int insert(Address record);
    @Insert("    insert into os_address (address_id, user_id, user_name, user_tag, user_phone, user_adress, user_zipcode, create_time, update_time values (#{addressId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR},     #{userTag,jdbcType=VARCHAR}, #{userPhone,jdbcType=VARCHAR}, #{userAdress,jdbcType=VARCHAR},      #{userZipcode,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}  )")
    int insertSelective(Address record);
//
//    Address selectByPrimaryKey(Long addressId);
//
    @Select("select * from os_address where user_id = #{userId,jdbcType=BIGINT};")
    List<Address> selectByUserId(int userId);
//
//    Address selectByAddressId(Long addressId);
//
//    int updateByPrimaryKeySelective(Address record);
//
//    int updateByPrimaryKey(Address record);
}
